|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
Drivers for central accelerometer. More...
Go to the source code of this file.
Defines | |
| #define | TRUE (1u) |
| #define | CLEAR (0u) |
| #define | BITS_IN_NIBBLE (4u) |
| #define | BITS_IN_BYTE (8u) |
| #define | BYTES_IN_16 (2u) |
| #define | BYTES_IN_32 (4u) |
| #define | BIT_DEFINITION |
| #define | BIT0 (1u << 0u) |
| #define | BIT1 (1u << 1u) |
| #define | BIT2 (1u << 2u) |
| #define | BIT3 (1u << 3u) |
| #define | BIT4 (1u << 4u) |
| #define | BIT5 (1u << 5u) |
| #define | BIT6 (1u << 6u) |
| #define | BIT7 (1u << 7u) |
| #define | BIT8 (1u << 8u) |
| #define | BIT9 (1u << 9u) |
| #define | BIT10 (1u << 10) |
| #define | BIT11 (1u << 11) |
| #define | BIT12 (1u << 12) |
| #define | BIT13 (1u << 13) |
| #define | BIT14 (1u << 14) |
| #define | BIT15 (1u << 15) |
| #define | BIT16 (1u << 16) |
| #define | BIT17 (1u << 17) |
| #define | BIT18 (1u << 18) |
| #define | BIT19 (1u << 19) |
| #define | BIT20 (1u << 20) |
| #define | BIT21 (1u << 21) |
| #define | BIT22 (1u << 22) |
| #define | BIT23 (1u << 23) |
| #define | BIT24 (1u << 24) |
| #define | BIT25 (1u << 25) |
| #define | BIT26 (1u << 26) |
| #define | BIT27 (1u << 27) |
| #define | BIT28 (1u << 28) |
| #define | BIT29 (1u << 29) |
| #define | BIT30 (1u << 30) |
| #define | BIT31 (1u << 31) |
| #define | RAW_ACCEL_MODE 7u |
| #define | OC_ACCEL_MODE 3u |
| #define | CA_TEST_SAMPLES_AMOUNT 256u |
| #define | CA_TEST_RAW_LIMIT_LO 1988u |
| #define | CA_TEST_RAW_LIMIT_HI 2108u |
| #define | CA_TEST_RAW_LIMIT_HYST 5u |
| #define | CA_TEST_OC_LIMIT_LO 2047u |
| #define | CA_TEST_OC_LIMIT_HI 2049u |
| #define | CA_TEST_SELF_LIMIT_LO 442u |
| #define | CA_TEST_SELF_LIMIT_HI 663u |
| #define | CA_TEST_SELF_RAW_VS_OC_LIMIT 5u |
| #define | CA_TEST_SELF_CROSS_AXIS_LIMIT 10u |
| #define | STATUS_CA_FAILED (BIT27 | BIT26) |
| #define | STATUS_CA_RAW_X_FAILED 0x00000001 |
| #define | STATUS_CA_RAW_Y_FAILED 0x00000002 |
| #define | STATUS_CA_RAW_SELF_X_FAILED 0x00000004 |
| #define | STATUS_CA_RAW_SELF_Y_FAILED 0x00000008 |
| #define | STATUS_CA_RAW_HYST_X_FAILED 0x00000010 |
| #define | STATUS_CA_RAW_HYST_Y_FAILED 0x00000020 |
| #define | STATUS_CA_OC_X_FAILED 0x00000040 |
| #define | STATUS_CA_OC_Y_FAILED 0x00000080 |
| #define | STATUS_CA_OC_SELF_X_FAILED 0x00000100 |
| #define | STATUS_CA_OC_SELF_Y_FAILED 0x00000200 |
| #define | STATUS_CA_OC_HYST_X_FAILED 0x00000400 |
| #define | STATUS_CA_OC_HYST_Y_FAILED 0x00000800 |
| #define | N_ELEMENTS(X) (sizeof(X)/sizeof(*(X))) |
Functions | |
| uint32_t | u32fnMMA6800ReadAccelSum (const uint8_t u8Axis, const uint8_t u8AccelMode, uint32_t *pu32Destination, const uint8_t cu8Accel) |
| Performs the reading and the sum of a CA_TEST_SAMPLES_AMOUNT acceleration data collection. This sum is used instead of averaging during CA diagnosis. | |
| uint32_t | u32fnMMA6800ConfigTest (uint32_t *pu32Destination, const uint16_t *pu16DataToSend, const uint8_t u8Size, const uint8_t u8AccelMode, const uint8_t u8Axis, const uint8_t cu8Accel) |
| Performs the configuration of CA plus the acceleration measurements for a dedicated test. | |
| uint32_t | u32fnMMA6800PreSelfTest (uint32_t *pu32Destination, const uint16_t *pu16DataToSend, const uint8_t u8Size, const uint8_t cu8AccelMode, const uint8_t cu8Axis, const uint16_t cu16LowLimit, const uint16_t cu16HighLimit, const uint32_t cu32StatusErrCode, const uint8_t cu8Accel) |
| Performs the Pre Self test verification (Test1) | |
| uint32_t | u32fnMMA6800PowerOnSelfTest (uint32_t *pu32Destination, const uint16_t *pu16DataToSend, const uint16_t *pu16DataToSendCross, const uint8_t u8Size, const uint8_t cu8AccelMode, const uint8_t cu8Axis, const uint32_t cu32StatusErrCode, const uint8_t cu8Accel) |
| Performs the Power ON Self test verification (Test2) | |
| uint32_t | u32fnMMA6800PostSelfTest (uint32_t *pu32Destination, const uint16_t *pu16DataToSend, const uint8_t u8Size, const uint8_t cu8AccelMode, const uint8_t cu8Axis, const uint32_t cu32StatusErrCode, const uint8_t cu8Accel) |
| Performs the Post Self test verification (Test3) | |
Variables | |
| const uint16_t | cau16MMA6800TestSettingsRaw [] |
| const uint16_t | cau16MMA6800TestSettingsRawSelfX [] |
| const uint16_t | cau16MMA6800TestSettingsRawSelfY [] |
| const uint16_t | cau16MMA6800TestSettingsOC [] |
| const uint16_t | cau16MMA6800TestSettingsOCSelfX [] |
| const uint16_t | cau16MMA6800TestSettingsOCSelfY [] |
| const uint32_t | cau32MMA6800ErrorCodeX [] |
| const uint32_t | cau32MMA6800ErrorCodeY [] |
| const uint8_t | cu8SizeofTestSettings |
| const uint8_t | cu8SizeofTestAmount |
Drivers for central accelerometer.
Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary
History:
| uint32_t u32fnMMA6800ConfigTest | ( | uint32_t * | pu32Destination, |
| const uint16_t * | pu16DataToSend, | ||
| const uint8_t | u8Size, | ||
| const uint8_t | u8AccelMode, | ||
| const uint8_t | u8Axis, | ||
| const uint8_t | cu8Accel | ||
| ) |
Performs the configuration of CA plus the acceleration measurements for a dedicated test.
| pu32Destination,: | Array of CA_TEST_SAMPLES_AMOUNT accelerations |
| pu16DataToSend,: | Array of settings to apply to CA to perform test |
| u8Size,: | Size of the array of settings |
| u8AccelMode,: | Raw or Offset Canceled (OC) |
| u8Axis,: | Axis along which accelerations are taken |
| cu8Accel,: | FSL Accelerometer (MESQUITE or SYCAMORE) |
| uint32_t u32fnMMA6800PostSelfTest | ( | uint32_t * | pu32Destination, |
| const uint16_t * | pu16DataToSend, | ||
| const uint8_t | u8Size, | ||
| const uint8_t | cu8AccelMode, | ||
| const uint8_t | cu8Axis, | ||
| const uint32_t | cu32StatusErrCode, | ||
| const uint8_t | cu8Accel | ||
| ) |
Performs the Post Self test verification (Test3)
| pu32Destination,: | Array of CA_TEST_SAMPLES_AMOUNT accelerations |
| pu16DataToSend,: | Array of settings to apply to CA to perform test |
| u8Size,: | Size of the array of settings |
| cu8AccelMode,: | Raw or Offset Canceled (OC) |
| cu8Axis,: | Axis along which accelerations are taken |
| cu32StatusErrCode,: | Error status code |
| cu8Accel,: | FSL Accelerometer (MESQUITE or SYCAMORE) |
| uint32_t u32fnMMA6800PowerOnSelfTest | ( | uint32_t * | pu32Destination, |
| const uint16_t * | pu16DataToSend, | ||
| const uint16_t * | pu16DataToSendCross, | ||
| const uint8_t | u8Size, | ||
| const uint8_t | cu8AccelMode, | ||
| const uint8_t | cu8Axis, | ||
| const uint32_t | cu32StatusErrCode, | ||
| const uint8_t | cu8Accel | ||
| ) |
Performs the Power ON Self test verification (Test2)
| pu32Destination,: | Array of CA_TEST_SAMPLES_AMOUNT accelerations |
| pu16DataToSend,: | Array of settings to apply to CA to perform test along main axis |
| pu16DataToSendCross,: | Array of settings to apply to CA to perform test \ along cross axis |
| u8Size,: | Size of the array of settings |
| cu8AccelMode,: | Raw or Offset Canceled (OC) |
| cu8Axis,: | Axis along which accelerations are taken (main axis) |
| cu32StatusErrCode,: | Error status code |
| cu8Accel,: | FSL Accelerometer (MESQUITE or SYCAMORE) |
| uint32_t u32fnMMA6800PreSelfTest | ( | uint32_t * | pu32Destination, |
| const uint16_t * | pu16DataToSend, | ||
| const uint8_t | u8Size, | ||
| const uint8_t | cu8AccelMode, | ||
| const uint8_t | cu8Axis, | ||
| const uint16_t | cu16LowLimit, | ||
| const uint16_t | cu16HighLimit, | ||
| const uint32_t | cu32StatusErrCode, | ||
| const uint8_t | cu8Accel | ||
| ) |
Performs the Pre Self test verification (Test1)
| pu32Destination,: | Array of CA_TEST_SAMPLES_AMOUNT accelerations |
| pu16DataToSend,: | Array of settings to apply to CA to perform test |
| u8Size,: | Size of the array of settings |
| cu8AccelMode,: | Raw or Offset Canceled (OC) |
| cu8Axis,: | Axis along which accelerations are taken |
| cu16LowLimit,: | Low limit for test |
| cu16HighLimit,: | High limit for test |
| cu32StatusErrCode,: | Error status code |
| cu8Accel,: | FSL Accelerometer (MESQUITE or SYCAMORE) |
| uint32_t u32fnMMA6800ReadAccelSum | ( | const uint8_t | u8Axis, |
| const uint8_t | u8AccelMode, | ||
| uint32_t * | pu32Destination, | ||
| const uint8_t | cu8Accel | ||
| ) |
Performs the reading and the sum of a CA_TEST_SAMPLES_AMOUNT acceleration data collection. This sum is used instead of averaging during CA diagnosis.
| u8Axis,: | Axis to perform the acceleration readings |
| u8AccelMode,: | Acceleration mode to perform the accel readings |
| pu32Destination,: | Sum of CA_TEST_SAMPLES_AMOUNT consecutive acceleration readings |
| cu8Accel,: | FSL Accelerometer (MESQUITE or SYCAMORE) |